//https://leetcode.cn/problems/que-shi-de-shu-zi-lcof/
class Solution {
    public int takeAttendance(int[] records) {
        int[] hash = new int[records.length+1];
        for (int i = 0; i < records.length; i++) {
            hash[records[i]]++;
        }
        int index = -1;
        for (int i = 0; i < hash.length; i++) {
            if (hash[i] == 0) index = i;
        }
        return index;
    }
}